home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1998 August / PC Direct August 1998.iso / S / powerj / Product / hpp.z / WANIMATE.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  4.9 KB  |  167 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WAnimation -- Wrapper for the Windows 95 Animation control.
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *       AnimationStart --
  19.  *
  20.  *       AnimationStop --
  21.  *
  22.  *************************************************************************/
  23.  
  24. #ifndef _WANIMATE_HPP_INCLUDED
  25. #define _WANIMATE_HPP_INCLUDED
  26. #pragma once
  27.  
  28. #ifndef _WNO_PRAGMA_PUSH
  29. #pragma pack(push,8);
  30. #pragma enum int;
  31. #endif
  32.  
  33. #ifndef _WRESID_HPP_INCLUDED
  34. #  include "wresid.hpp"
  35. #endif
  36. #ifndef _WCONTROL_HPP_INCLUDED
  37. #  include "wcontrol.hpp"
  38. #endif
  39. #ifndef _WSTRING_HPP_INCLUDED
  40. #  include "wstring.hpp"
  41. #endif
  42.  
  43. //
  44. // Animation styles
  45. //
  46.  
  47. #define WSACCenter              ((WStyle)0x00000001L) // ACS_CENTER
  48. #define WSACCentered            ((WStyle)0x00000001L) // ACS_CENTER
  49. #define WSACTransparent         ((WStyle)0x00000002L) // ACS_TRANSPARENT
  50. #define WSACAutoPlay            ((WStyle)0x00000004L) // ACS_AUTOPLAY
  51.  
  52. class WCMCLASS WAnimation : public WControl {
  53.     WDeclareSubclass( WAnimation, WControl );
  54.     
  55.     public:
  56.     
  57.         /************************************************************
  58.          * Constructors and Destructors
  59.          ************************************************************/
  60.  
  61.         WAnimation();
  62.     
  63.         ~WAnimation();
  64.     
  65.         /************************************************************
  66.          * Properties
  67.          ************************************************************/
  68.  
  69.         // AutoPlay
  70.         //
  71.         //    If TRUE, animation window automatically plays the
  72.         //    animation when it is loaded.
  73.  
  74.         WBool GetAutoPlay() const;
  75.         WBool SetAutoPlay( WBool on );
  76.  
  77.         // Centered
  78.         //
  79.         //    If TRUE, animation is centered within the window
  80.         //    when played.
  81.  
  82.         WBool GetCentered() const;
  83.         WBool SetCentered( WBool center );
  84.  
  85.         // Transparent
  86.         //
  87.         //    If TRUE, animation background is transparent.
  88.  
  89.         WBool GetTransparent() const;
  90.         WBool SetTransparent( WBool transparent );
  91.  
  92.         /*************************************************************
  93.          * Methods
  94.          *************************************************************/
  95.  
  96.         // Close
  97.         //
  98.         //    Close a .AVI file/resource.
  99.  
  100.         WBool Close();
  101.  
  102.         // Open
  103.         //
  104.         //    Open a .AVI file/resource for playing.  The resource can
  105.         //    only come from the .EXE resources.
  106.  
  107.         WBool Open( const WChar *aviFileName );
  108.         WBool Open( const WResourceID & id );
  109.  
  110.         // Play
  111.         //
  112.         //    Play the opened file numTimeToRepeat times (a value
  113.         //    of -1 means play forever) from frame #startFrame
  114.         //    to frame #endFrame.  Frames are numbered from 0 to
  115.         //    65535.  A value of -1 for endFrame means play until
  116.         //    the end.
  117.  
  118.         WBool Play( WInt numTimesToRepeat=-1, WShort startFrame=0,
  119.                     WShort endFrame=-1 );
  120.  
  121.         // Seek
  122.         //
  123.         //    Move to a certain frame in the .AVI clip.
  124.  
  125.         WBool Seek( WShort frame )
  126.             { return Play( 1, frame, frame ); }
  127.  
  128.  
  129.         // Stop
  130.         //
  131.         //    Stop playing the .AVI clip.
  132.  
  133.         WBool Stop();
  134.  
  135.         /***************************************************************
  136.          * Overrides
  137.          ***************************************************************/
  138.  
  139.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  140.                                    void * data=NULL );
  141.  
  142.         virtual WBool ProcessCommand( WUInt id, WNotify code,
  143.                                       WNotifyInfo info, WLong & returns );
  144.  
  145.         virtual const WChar * InitializeClass();
  146.  
  147.         virtual WStyle GetDefaultStyle() const;
  148.  
  149.         /***************************************************************
  150.          * Data Members
  151.          ***************************************************************/
  152.  
  153.     private:
  154.  
  155.         WString                 _aviFileName;
  156.         WResourceID             _aviID;
  157.         WBool                   _hasFileName;
  158.         WBool                   _hasID;
  159. };
  160.  
  161. #ifndef _WNO_PRAGMA_PUSH
  162. #pragma enum pop;
  163. #pragma pack(pop);
  164. #endif
  165.  
  166. #endif // _WANIMATE_HPP_INCLUDED
  167.